﻿using System;
using System.Data;
using TimKen.DataEntity;
using System.Collections.Generic;

namespace TimKen.BussLogic
{
    /// <summary>
    /// 订单业务逻辑操作类
    /// </summary>
    public class OrderItemManager
    {
        private readonly TimKen.DataAccess.OrderItemDAO  dal = new TimKen.DataAccess.OrderItemDAO();
        public OrderItemManager()
        { }
        #region  成员方法
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(string OrderItemID)
        {
         
            return dal.Exists(OrderItemID);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(TimKen.DataEntity.OrderItem model)
        {
            model.OrderItemID = Guid.NewGuid().ToString();
            dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(TimKen.DataEntity.OrderItem model)
        {
            dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public void Delete(string OrderItemID)
        {

            dal.Delete(OrderItemID);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public TimKen.DataEntity.OrderItem GetModel(string OrderItemID)
        {

            return dal.GetModel(OrderItemID);
        }

       

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }


        public DataSet GetOrderItems(string OrderID) {
            return dal.GetOrderItems(OrderID);
        }

        public List<OrderItem> GetOrderItemList(string OrderID)
        {
            return dal.GetOrderItemList(OrderID);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  成员方法
    }
}
